<?php
namespace app\admin\validate;
use think\Validate;

class Goods extends Validate
{
    protected $rule = [
        'title'=>'unique:goods|require|max:25',
        'desc'=>'require',
    ];

    protected $message  =   [
        'title.require' => '商品标题必须填写',
        'title.max' => '商品标题长度不得大于25位',
        'title.unique'=>'商品标题不得重复！',
        'desc.require'=>'商品描述不得为空！',
    ];

    protected $scene = [
        'add'=>['title','desc'],
        'edit'  =>  ['title'],
    ];

}